package com.example.sls.service.impl.teacher;

import com.example.sls.mapper.teacher.TeacherMapper;
import com.example.sls.pojo.teacher.Teacher;
import com.example.sls.service.teacher.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public List<Teacher> getTeacherInfo() {
        return teacherMapper.getTeacherInfo();
    }

    @Override
    public Teacher getTeacherById(Integer id) {
        return teacherMapper.getTeacherById(id);
    }

    @Override
    public Teacher getTeacherByTId(Integer tid) {
        return teacherMapper.getTeacherByTId(tid);
    }

    @Override
    public Boolean addTeacher(Teacher teacher) {
        boolean flag = false;
        if(teacherMapper.addTeacher(teacher) > 0){
            flag = true;
        }
        return flag;
    }

    @Override
    public Integer getMaxId() {
        return teacherMapper.getMaxId();
    }

    @Override
    public Integer getCount() {
        return teacherMapper.getCount();
    }
}
